package com.xfapp.demos.controller;


import com.xfapp.demos.common.Result;
import com.xfapp.demos.entity.DataStructure;
import com.xfapp.demos.service.IChapterService;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jinYi
 * @since 2025-06-04
 */
@RestController
@RequestMapping("/chapter")
public class ChapterController {
    @Resource
    private IChapterService chapterService;

    @GetMapping("/data-structure/{chapterId}")
    public Result<DataStructure> getDataStructure(@PathVariable Long chapterId) {
        DataStructure dataStructure = chapterService.getDataStructureFromChapterTable(chapterId);
        return Result.success(dataStructure);
    }
}
